package com.aishare.qicaitaoke.utils;

import android.content.Context;

/**
 * 作者luwenming
 * 时间2018/1/31
 */

public class UiUtils {

    public static float dip2px(Context context,float dipValue){
        float scale = context.getResources().getDisplayMetrics().density;
        return dipValue*scale + 0.5f;
    }

    public static int px2dip(Context context,float pxValue){
       float scale =  context.getResources().getDisplayMetrics().density;
        return (int) (pxValue/scale+0.5f);
    }

}
